<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="app">
    <my-com>
<!--        表示，当前div要放到name=cpu的子组件的slot标签上-->
        <div slot="cpu">Intel Core i9</div>
<!--具名插槽     -->
        <div slot="memory">内存条</div>
        <div slot="hard-drive">硬盘</div>
    </my-com>
</div>
<template id="mycom">
    <div>
        <slot name="cpu">这里是插CPU的</slot>
        <slot name="hard-drive">这里是插硬盘</slot>
        <slot name="memory">这里是插内存条的</slot>
    </div>
</template>
<script>

    Vue.component('my-com',{
        template: '#mycom'
    })
    new Vue({
        el: '#app'
    })
</script>
</body>
</html>
